package model

import (
	"github.com/jmoiron/sqlx"
	. "zimuzu_cvn_web_api/pkg/e"
)

//检查是否在黑名单中
//Auth: TXG
func IsBlackUser(db sqlx.Queryer, uid int64) (bool, error) {
	var count int
	err := db.QueryRowx("SELECT count(*) FROM user_upload_black WHERE uid = ?", uid).Scan(&count)
	if err != nil {
		Log("err", err)
		return false, err
	}
	if count == 0 {
		return false, nil
	}
	return true, nil
}